"""
@Project:Efficient
@File:urls.py
@Author:郑凯乐
@Date:14:15
"""
from django.urls import path
from .views import *
from rest_framework.routers import DefaultRouter
urlpatterns = [
    # 登录
    path('login/', UserView.as_view({'post':'login'})),
    # 获取所有用户信息
    path("userinfos/",UserView.as_view({"get":"userall"})),
    # 获取单个用户信息，修改用户
    path('userinfo/', UserView.as_view({'get':'user_desc','put':'upd_user'})),
    # 图片验证码
    path('imgcaptcha/',UserView.as_view({"get":"get_img"})),
    # 发送短信验证码
    path('send_code/<int:pk>/', UserView.as_view({"get":"msg_code"})),
    #找回密码
    path('pwdfind/',UserView.as_view({"put":"find_pwd"})),
    #职级信息
    path("ranks/",RankView.as_view({"get":"ranksall",'post':'add_rank'})),
    path('rank/<int:pk>/', RankView.as_view({'put':'upd_rank','delete':'del_rank'})),
    # 部门信息
    path('sections/', Department.as_view({'get':'depsall','post':'add_dept'})),
    path('section/<int:pk>/', Department.as_view({'put':'upd_dept','delete':'del_dept'})),
    #统计员工人数
    path("countnums/",StaffCountView.as_view({"get":"staff_count"})),
    # 地区
    path("address/",StaffCountView.as_view({"get":"staff_address"})),
    # 生日
    path("birthday/",StaffCountView.as_view({"get":"staff_birthday"})),
    #获取目录
    path("catelogs/",CateLogView.as_view({"get":"get_catalog",'post': 'add_catalog'})),
    # 获取一个 目录,修改，删除
    path('catalogs/<int:pk>/', CateLogView.as_view({'get': 'retrieve_catalog','put': 'revamp_catalog', 'delete': 'destroy_catalog'})),
    #材料管理
    path("matetals/",MaterialsView.as_view({"get":"matetals_all",'post':'matetals_add'})),
    path("matetal/<int:pk>",MaterialsView.as_view({"delete":"matetals_del"})),
    #工资信息
    path("prices/",PricesView.as_view({"get":"price_all"})),


]
